<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>变形和动画的结合使用</title>
    <style>
      .card-con {
        cursor: pointer;
        height: 300px;
        perspective: 200;
        position: relative;
        width: 300px;
        background-color: deeppink;
      }
      .card {
        height: 80%;
        position: absolute;
        transform-style: preserve-3d;
        transition: all 2s ease-in;
        width: 80%;
        background-color: deepskyblue;
      }
      .card:hover {
        transform: rotateY(180deg);
      }
      .side {
        /*  backface-visibility 属性定义当元素不面向屏幕时是否可见。hidden不可见visible可见 */
        background-color: gold;
        backface-visibility: hidden;
        border-radius: 15px;
        position: absolute;
        /*  overflow 属性规定当内容溢出元素框时发生的事情。  */
        overflow: hidden;
        width: 80%;
      }
      .back {
        background: rgba(76, 0, 130, 0.534);
        color: white;
        line-height: 180px;
        text-align: center;
        transform: rotateY(180deg);
      }
    </style>
  </head>
  <body>
    <div class="card-con">
      <div class="card">
        <div class="side"><img src="/08/pic/sa.jpg" alt="撒贝宁" /></div>
        <div class="side back">北大还行</div>
      </div>
    </div>
  </body>
</html>
